package com.yanqu.road.server.cmd.activity.bulletscreen;

import com.yanqu.road.pb.activity.BulletScreenProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.bulletscreen.BulletScreenModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_ACTIVITY_READ_BULLET_SCREEN_COMMENTS, desc = "弹幕标识已读")
public class BulletScreenContentReadCmd extends AbstractCommand {

    long contentId;
    int activityId;
    int type;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        BulletScreenProto.BulletScreenContentReadReqMsg reqMsg = BulletScreenProto.BulletScreenContentReadReqMsg.parseFrom(packet.getBytes());
        contentId = reqMsg.getContentId();
        activityId = reqMsg.getActivityId();
        type = reqMsg.getType();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
      ret = player.getModule(BulletScreenModule.class).setBulletScreenReadId(activityId, contentId, type);

    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
